<div class="content-table">
    <?php
        echo $this->partial('topo_list.phtml', array(
            'titulo' => $this->titulo,
            'controller' => $this->controller, 
            'search' => $this->search,
            'add'   =>  $this->per_add, 
            'filtro'=> TRUE,
            'form_search' => TRUE,
        ));
    ?> 
    <table id="tlist" class="tb_content">
        <thead>
            <tr>
                <th>Data/Hora</th>
                <th>Curso</th>
                <th>Comprador</th>
                <th>Forma Pag.</th>
                <th>Valor</th>
                <th>Status</th>
                <th>&nbsp;</th>
            </tr>
        </thead>
        <tbody>
            <?php foreach ($this->result as $row) { 
                $cur = $row->findDependentRowSet("Ead_Model_DbTable_Curso");
                $usu = $row->findDependentRowSet("Ead_Model_DbTable_Usuarios");
                ?>
                <tr>  
                    <td><?php echo Datetools::invertDH($row->COM_DATHOR); ?></td>
                    <td align="left"><?php echo $cur[0]['CUR_NOM']; ?></td>
                    <td align="left"><?php echo $usu[0]['USU_NOME']; ?></td>
                    <td><?php echo compras::getformasPagamento($row->COM_TPOPAG); ?>
                        <?php if($row->COM_VES > 0){ echo ' / '.$row->COM_VES.' x';  } ?>
                    </td>
                    <td><?php echo tools::float_to_money($row->COM_VLR); ?></td>
                    <td><?php echo $this->status[$row->COM_STATRA]; ?></td>
                    <td class="t_btn_ac">
                        <?php if($this->per_del){?><a class="btn-cancel-list" href="javascript:void(0);" onclick="list_delete('<?php echo $this->controller; ?>', <?php echo $row->COM_ID ?>, $(this));">Deletar</a><?php }?>
                        <?php if($this->per_edt){?><a class="btn-edt-list" href="<?php echo $this->url(array('controller' => $this->controller, 'action' => 'edit', 'id' => $row->COM_ID)); ?>">Editar</a><?php }?>
                    </td>
                </tr>
            <?php } ?>
        </tbody>
    </table>
</div>
<?php echo $this->paginationControl($this->paginator, 'Sliding', 'pagination.phtml'); ?>
